package com.mdb.open.trade.domain.vo.customer;

/*
 * Copyright (C), 2017-2019 澳发科技(MDB)
 * FileName: MerchantInfoService.java
 * Author:   符楚
 * Date:     2019-06-11
 * History:
 * <author>          <time>          <version>          <desc>
 * 符楚               2019-06-11          V1.00             代码生成器初始生成代码
 * -----------------------------------------------------------
 * 作者姓名           修改时间           版本号            描述
 */


import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mdb.bc.api.data.DataObjectBase;
import com.mdb.bc.web.jackson.serializer.FileURL;
import com.mdb.open.common.enums.trade.status.AvailableStatusEnum;
import com.mdb.open.common.enums.trade.status.MerchantApproveStatusEnum;
import com.mdb.open.common.enums.trade.status.MerchantStatusEnum;
import com.mdb.open.common.enums.trade.type.BusinessNatureTypeEnum;
import com.mdb.open.common.enums.trade.type.CertTypeEnum;
import com.mdb.open.common.enums.trade.type.MerchantsTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;

/**
 * 类描述：
 * 商户信息视图类
 *
 * @author 符楚
 * @date 2019-06-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(description = "商户信息Vo对象")
public class MerchantInfoVo extends DataObjectBase {

    private static final long serialVersionUID = 1L;

    @Size(max = 64)
    @ApiModelProperty(value = "商户号")
    private String merchantNo;

    @ApiModelProperty(value = "商户类型")
    private MerchantsTypeEnum merchantType;

    @Size(max = 64)
    @ApiModelProperty(value = "商户英文名称")
    private String merchantNameEn;

    @Size(max = 64)
    @ApiModelProperty(value = "商户中文名称")
    private String merchantNameCn;

    @Size(max = 64)
    @ApiModelProperty(value = "商户证件号码")
    private String merchantCertNumber;

    @FileURL
    @Size(max = 256)
    @ApiModelProperty(value = "营业执照附件URL")
    private String bizLicenseFile;

    @Size(max = 64)
    @ApiModelProperty(value = "企业法人代表")
    private String principalName;

    @ApiModelProperty(value = "证件类型")
    private CertTypeEnum principalCertType;

    @Size(max = 64)
    @ApiModelProperty(value = "证件号码")
    private String principalCertNumber;

    @FileURL
    @Size(max = 256)
    @ApiModelProperty(value = "证件照正面URL")
    private String principalCertFrontFile;

    @FileURL
    @Size(max = 256)
    @ApiModelProperty(value = "证件照反面URL")
    private String principalCertBackFile;

    @ApiModelProperty(value = "经营性质")
    private BusinessNatureTypeEnum businessNature;

    @Size(max = 64)
    @ApiModelProperty(value = "联系人")
    private String contactName;

    @Size(max = 5)
    @ApiModelProperty(value = "联系电话(区号)")
    private String contactPhoneCode;

    @Size(max = 64)
    @ApiModelProperty(value = "联系电话")
    private String contactPhoneNumber;

    @Size(max = 64)
    @ApiModelProperty(value = "联系邮箱")
    private String contactEmail;

    @Size(max = 64)
    @ApiModelProperty(value = "联系地址")
    private String contactAddress;

    @ApiModelProperty(value = "商户状态")
    AvailableStatusEnum status;

    @ApiModelProperty(value = "融资账号")
    String merchantPlatformAccount;

    /**
     * 商户状态
     */
    @JsonIgnore
    @ApiModelProperty(value = "商户状态", hidden = true)
    private MerchantStatusEnum merchantStatus;

    /**
     * 风控状态(风控智审/风控人工审批/风控拒绝)
     */
    @JsonIgnore
    @ApiModelProperty(value = "风控状态", hidden = true)
    private MerchantApproveStatusEnum riskStatus;


    /**
     * 可用状态
     *
     * @return
     */
    public AvailableStatusEnum getStatus() {
        return AvailableStatusEnum.convert(merchantStatus, riskStatus);
    }
}
